<div class="header-menu-container"  *ngIf="!showMobileMenu">
  <div
    class="header-menu-item"
    *ngFor="let item of menuList"
    (click)="onSelect(item)"
    [ngClass]="{ 'menu-selected-item': item === selectedItem }"
  >
    <a *ngIf="item.href" class="menu-link" [href]="item.href" rel="noopener noreferrer" [target]="item.target ? item.target : '_blank'">
      <div class="logo" [innerHTML]="item.icon | safe: 'html'"></div>
      <div class="text">{{ curLanguage === 'zh-cn' ? item.name : item.enName }}</div>
    </a>
    <div
      *ngIf="!item.href"
      dDropDown
      appendToBody
      
      [appendToBodyDirections]="[{ originX: 'start', originY: 'center', overlayX: 'start', overlayY: 'top', offsetX: 50, offsetY: -16 }]"
      [trigger]="'click'"
    >
      <div class="logo" [innerHTML]="item.icon | safe: 'html'" dDropDownToggle></div>
      <div class="text">{{ curLanguage === 'zh-cn' ? item.name : item.enName }}</div>
      <div dDropDownMenu class="devui-scrollbar menu-list-wrapper">
        <div class="menu-lists" [ngClass]="{ 'menu-lists-specifications': item.name === '开发规范' }">
          <div class="menu-list">
            <ul class="menu-sublist">
              <li class="menu-sublist-item" *ngFor="let itemInSubList of item.children">
                <a
                  *ngIf="itemInSubList.href"
                  [href]="itemInSubList.href"
                  rel="noopener noreferrer"
                  [target]="itemInSubList.target ? itemInSubList.target : '_blank'"
                >
                <ng-container *ngIf="item.name === '开发规范'">
                  <span class="menu-sublist-title">{{ curLanguage === 'zh-cn' ? itemInSubList.name : itemInSubList.enName }}</span>
                  <span
                    class="menu-sublist-description"
                    *ngIf="itemInSubList.description"
                    title="{{ curLanguage === 'zh-cn' ? itemInSubList.description : itemInSubList.enDescription }}"
                  >
                    {{ curLanguage === 'zh-cn' ? itemInSubList.description : itemInSubList.enDescription }}
                  </span>
                </ng-container>
                <div class="menu-ecology-container" *ngIf="item.name !== '开发规范'">
                  <div class="ecology-icon-container" [innerHTML]="itemInSubList.icon | safe: 'html'"></div>
                  <div class="ecology-desc-container">
                    <p class="menu-sublist-title">{{ curLanguage === 'zh-cn' ? itemInSubList.name : itemInSubList.enName }}</p>
                    <p
                      class="menu-sublist-description"
                      *ngIf="itemInSubList.description"
                      title="{{ curLanguage === 'zh-cn' ? itemInSubList.description : itemInSubList.enDescription }}"
                    >{{ curLanguage === 'zh-cn' ? itemInSubList.description : itemInSubList.enDescription }}
                  </p>
                  </div>
                </div>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="mobile-menu" *ngIf="showMobileMenu">
  <d-accordion
    [titleKey]="'name'"
    [linkKey]="'href'"
    [linkType]="'hrefLink'"
    [data]="menuList"
    [itemTemplate]="menutemplate"
    [menuItemTemplate]="menutemplate"
    [accordionType]="'embed'"
  ></d-accordion>
  <ng-template #menutemplate let-item="item">
    <div class="mobile-menu-wrapper">
      <div class="logo" [innerHTML]="item.icon | safe: 'html'"></div>
      <div class="text">{{ curLanguage === 'zh-cn' ? item.name : item.enName }}</div>
    </div>
  </ng-template>
</div>